import { Ref, ref } from "vue";
import { GlobalThemeOverrides } from "naive-ui";
import { Instance } from "ys-ts/src/ts/instance";

export function useThemOverrides(): Ref<GlobalThemeOverrides> {
  // 通过单例管理 主题变量
  return Instance.Instance().getOrSetFunc("theme-light", () =>
    ref<GlobalThemeOverrides>({})
  );
}

export function useThemOverridesDark(): Ref<GlobalThemeOverrides> {
  // 通过单例管理 主题变量
  return Instance.Instance().getOrSetFunc("theme-dark", () =>
    ref<GlobalThemeOverrides>({})
  );
}
